package com.webbei.HAO.action;

import java.io.IOException;

import org.apache.struts2.ServletActionContext;

import com.webbei.HAO.service.ChSer;

public class UpdataPwdByEmailAction {
	private String email;
	private String password;
	private ChSer ser;
	 
	public String execute(){
		System.out.println(email+","+password);
		boolean i=ser.updatePwdbyEmail(email, password);
		if(i){
			try {
				ServletActionContext.getResponse().getWriter().write("success");
				ServletActionContext.getResponse().setContentType("text/html");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}else{
			try {
				ServletActionContext.getResponse().getWriter().write("fail");
				ServletActionContext.getResponse().setContentType("text/html");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return null;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public ChSer getSer() {
		return ser;
	}
	public void setSer(ChSer ser) {
		this.ser = ser;
	}
	
}
